<template>
  <div id="app">
    <router-link to="/user/ranger">用户Ranger</router-link>
    <router-link to="/user/jack">用户jack</router-link>
    <button @click="goToDashboard">点击跳转到 Dashboard</button>
    <button @click="goBack">返回上一页</button>
    <router-view />
  </div>
</template>

<script>
export default {
  methods: {
    goBack: function () {
      this.$router.go(-1);
    },
    goToDashboard: function () {
      this.$router.push({
        path: "/dashboard",
      });
    },
  },
};
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

nav {
  padding: 30px;
}

nav a {
  font-weight: bold;
  color: #2c3e50;
}

nav a.router-link-exact-active {
  color: #42b983;
}
</style>
